﻿

using System;
using System.Collections;

namespace ConsoleAppStack
{
    class Program
    {
        static void Main(string[] args)
        {

            Stack stack = new Stack();
            stack.Push("001");
            stack.Push("002");
            stack.Push("003");
            stack.Push("004");
            stack.Push("005");

            Console.WriteLine("上刑场");
            foreach (var item in stack)
            {
                Console.WriteLine(item + "全部就位");
            }

            Console.WriteLine("一共{0}人，准备枪决",stack.Count);

            stack.Clear();
            Console.WriteLine("枪决完毕，剩余人数{0}",stack.Count);

           bool people= stack.Contains("005"); 
            if (people)
            {
                Console.WriteLine("005没死");
            }
            else
            {
                Console.WriteLine("该死刑犯已死");
            }

        }
    }
}
